<template>
  <div class="equip-info">
    <div class="botton_sabe">
      <el-button
      v-debounce
        type="primary"
        size="small"
        :icon="Platform"
        @click="SaveBEMProcessDatasD"
        >保存工艺数据</el-button
      >
    </div>
    <div style="display: flex; align-items: center;position: relative;">

     <div class="content_steps_ab" style="position: absolute;">
      <div style='display: flex; align-items: center;width:50%'>
	<span style="font-size:11px;font-weight:bold;color:#13ce66">设计状态：</span>
				<el-steps
				style='width:78%;transform: scale(0.8) translate(-10%,-11%);'
        :space="120"
        :active="activeNumber"
        finish-status="success"
        process-status="finish"
        align-center
        size="small"
       
      >
    
        <el-step  :icon="Edit" >
          <template #icon>
            <el-tooltip
            
placement="top-start"
trigger="hover"
content="设计"
>

<div v-if="activeNumber<=0" @click="changeStatue(10)" class="hand_me el-step__icon is-text"><div class="el-step__icon-inner">1</div></div>

<div style="color:#81cc5c" v-if="activeNumber>=1" @click="(e)=>changeStatue(10,e)" class="hand_me el-step__icon is-text  is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>

</el-tooltip>
           
       </template>
        </el-step>
        <el-step :icon="Refresh" >
          <template #icon>
            <el-tooltip
            
placement="top-start"
trigger="hover"
content="校核"
>

<div v-if="activeNumber<=1" @click="changeStatue(20)" class="hand_me el-step__icon is-text"><div class="el-step__icon-inner">2</div></div>

<div  style="color:#81cc5c" v-if="activeNumber>=2" @click="changeStatue(20)" class="hand_me el-step__icon is-text is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>

</el-tooltip>
           
       </template>
        </el-step>

      
        <el-step :icon="CircleCheck" >

          

          <template #icon>
            <el-tooltip
            
placement="top-start"
trigger="hover"
content="审核"
>

<div v-if="activeNumber<=2" @click="changeStatue(30)" class="hand_me el-step__icon is-text"><div class="el-step__icon-inner">3</div></div>

<div   style="color:#81cc5c" v-if="activeNumber>=3" @click="changeStatue(30)" class="hand_me el-step__icon is-text  is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>

</el-tooltip>
           
       </template>
        </el-step>
     
        <el-step :icon="CircleCheck" >

          

<template #icon>
  <el-tooltip
            
            placement="top-start"
            trigger="hover"
            content="已完成"
            >
            
            <div v-if="activeNumber<=2"  class="el-step__icon is-text"><div class="el-step__icon-inner">4</div></div>
            
            <div style="color:#81cc5c" v-if="activeNumber>=3"  class="el-step__icon is-text is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>
            
            </el-tooltip>
 
</template>
</el-step>
      </el-steps>
	</div>

	<div style='display: flex; align-items: center;width:50%;'>
	<span style="font-size:11px;font-weight:bold;color:#1890ff">模型状态：</span>
				<el-steps
				style='width:78%;transform: scale(0.8) translate(-10%,-11%);'
        :space="120"
        :active="activeNumberModel"
        finish-status="success"
        process-status="finish"
        align-center
        size="small"
       
      >
    
        <el-step  :icon="Edit" >
          <template #icon>
            <el-tooltip
            
placement="top-start"
trigger="hover"
content="设计"
>

<div v-if="activeNumberModel<=0" @click="changeStatueModel(10)" class="hand_me el-step__icon is-text"><div class="el-step__icon-inner">1</div></div>

<div style="color:#81cc5c" v-if="activeNumberModel>=1" @click="(e)=>changeStatueModel(10,e)" class="hand_me el-step__icon is-text  is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>

</el-tooltip>
           
       </template>
        </el-step>
        <el-step :icon="Refresh" >
          <template #icon>
            <el-tooltip
            
placement="top-start"
trigger="hover"
content="校核"
>

<div v-if="activeNumberModel<=1" @click="changeStatueModel(20)" class="hand_me el-step__icon is-text"><div class="el-step__icon-inner">2</div></div>

<div  style="color:#81cc5c" v-if="activeNumberModel>=2" @click="changeStatueModel(20)" class="hand_me el-step__icon is-text is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>

</el-tooltip>
           
       </template>
        </el-step>

      
        <el-step :icon="CircleCheck" >

          

<template #icon>
  <el-tooltip
            
            placement="top-start"
            trigger="hover"
            content="已完成"
            >
            
            <div v-if="activeNumberModel<=1"  class="el-step__icon is-text"><div class="el-step__icon-inner">3</div></div>
            
            <div style="color:#81cc5c" v-if="activeNumberModel>=2"  class="el-step__icon is-text is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>
            
            </el-tooltip>
 
</template>
</el-step>
      </el-steps>
	</div>
      
     </div>

      <h1>工艺设计</h1>
      &nbsp;

      <el-popover
   
        :visible="visible"
        placement="bottom-start"
        title="设备信息"
        :width="300"
        trigger="hover"
      >
        <template #reference>
          <el-icon @mouseenter="visible = true">
            <Warning />
          </el-icon>
        </template>
        <div @mouseleave="visible = false">
          <div class="content_detail">
            <div class="item_content_d">
              <div class="fontent_s">设备位号:</div>
              <div>{{ equipInfo.equip_no }}</div>
            </div>

            <div class="item_content_d">
              <div class="fontent_s">设备名称:</div>
              <div>{{ equipInfo.equip_name }}</div>
            </div>

            <div class="item_content_d">
              <div class="fontent_s">设备形式:</div>
              <div>{{ equipInfo.equip_type }}</div>
            </div>

            <div class="item_content_d">
              <div class="fontent_s">设备类型:</div>
              <div>{{ equipInfo.equip_class }}</div>
            </div>

            <div class="item_content_d">
              <div class="fontent_s">设计人员:</div>
              <div>{{ equipInfo.equip_designer }}</div>
            </div>
          </div>

          <div     v-if='false' class="content_top">
            <el-steps
              :space="100"
              :active="activeNumber < 2 ? activeNumber : 3"
              finish-status="success"
              process-status="finish"
              align-center
              size="small"
              style="font-size: 12px"
            >
              <el-step :icon="Edit" title="设计"></el-step>
              <el-step :icon="Refresh" title="审核"></el-step>
              <el-step :icon="CircleCheck" title="完成"></el-step>
            </el-steps>

            <div class="button_item_b">
              <el-popconfirm
                :teleported="false"
                placement="top"
                @confirm="designComplete"
                title="确定设计完成?"
              >
                <template #reference>
                  <el-button
                    :icon="Edit"
                    size="small"
                    @mouseenter.stop=""
                    type="primary"
                    >设计完成</el-button
                  >
                </template>
              </el-popconfirm>

              <el-popconfirm
                :teleported="false"
                placement="left"
                @confirm="checkComplete"
                title="确定审核通过?"
              >
                <template #reference>
                  <el-button
                    :icon="Refresh"
                    size="small"
                    @mouseenter.stop=""
                    type="success"
                    >审核完成</el-button
                  >
                </template>
              </el-popconfirm>
            </div>
          </div>
        </div>
      </el-popover>
    </div>

    <div v-if='false' class="from_tenbal style2">
      <transition name="el-zoom-in-top">
        <el-form
          v-show="showTran"
          label-position="top"
          :inline="true"
          ref="designformRef"
          size="small"
          label-width="120px"
        >
          <div class="flex_style">
            <el-form-item label="设计压力">
              <el-input
                class="unit_input"
                v-model="processForm.design_pressure"
                placeholder="请输入设计压力"
                size="small"
              ></el-input>
            </el-form-item>

            

            <el-form-item label="设计温度">
              <el-input
                class="unit_input"
                v-model="processForm.design_temp"
                placeholder="请输入温度"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="直径">
              <el-input
                class="unit_input"
                v-model="processForm.diameter"
                placeholder="请输入直径"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="切高">
              <el-input
                class="unit_input"
                v-model="processForm.TL_to_TL"
                placeholder="请输入切高"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="全容积">
              <el-input
                class="unit_input"
                v-model="processForm.full_volume"
                placeholder="请输入全容积"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="公称容积">
              <el-input
                class="unit_input"
                v-model="processForm.nominal_volume"
                placeholder="请输入公称容积"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="塔板类型/塔板数">
              <el-input
                class="unit_input"
                v-model="processForm.tower_plate_type_count"
                placeholder="请输入塔板类型/塔板数"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="填料高度">
              <el-input
                class="unit_input"
                v-model="processForm.packing_height"
                placeholder="请输入填料高度"
                size="small"
              ></el-input>
            </el-form-item>
            <el-form-item label="基本风压">
              <el-input
                class="unit_input"
                v-model="processForm.basic_wind_pressure"
                placeholder="请输入基本风压"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="地震设防烈度">
              <el-input
                class="unit_input"
                v-model="processForm.seismic_design_intensity"
                placeholder="请输入地震设防烈度"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="介质">
              <el-input
                class="unit_input"
                v-model="processForm.fluid"
                placeholder="请输入介质"
                size="small"
              ></el-input>
            </el-form-item>
            <el-form-item label="介质特性">
              <el-input
                class="unit_input"
                v-model="processForm.fluid_properties"
                placeholder="请输入介质特性"
                size="small"
              ></el-input>
            </el-form-item>
            <el-form-item label="介质密度(kg/m3)">
              <el-input
                class="unit_input"
                v-model="processForm.fluid_density"
                placeholder="请输入介质密度(kg/m3)"
                size="small"
              ></el-input>
            </el-form-item>
            <el-form-item label="保温厚度(mm)">
              <el-input
                class="unit_input"
                v-model="processForm.insulation_thickness"
                placeholder="请输入保温厚度(mm)"
                size="small"
              ></el-input>
            </el-form-item>
            <el-form-item label="主要受压元件材质">
              <el-input
                class="unit_input"
                v-model="processForm.main_pressure_comp_matl"
                placeholder="请输入主要受压元件材质"
                size="small"
              ></el-input>
            </el-form-item>
            <el-form-item label="图纸自然张数">
              <el-input
                class="unit_input"
                v-model="processForm.drawings_count"
                placeholder="请输入图纸自然张数"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="折A1张数">
              <el-input
                class="unit_input"
                v-model="processForm.A1_count"
                placeholder="请输入折A1张数"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="计算书自然张数">
              <el-input
                class="unit_input"
                v-model="processForm.cal_sheet_count"
                placeholder="请输入计算书自然张数"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="备注">
              <el-input
                class="unit_input"
                v-model="processForm.note"
                placeholder="请输入备注"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="风险评估报告">
              <el-select
                style="width: 160px"
                class="unit_input"
                v-model="processForm.risk_assessment_report"
                placeholder="请输入风险评估报告"
                size="small"
              >
                <el-option
                  v-for="item in [
                    {
                      value: '是',
                      label: '是',
                    },
                    {
                      value: '否',
                      label: '否',
                    },
                  ]"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </div>
        </el-form>
      </transition>
    </div>


    <div  style='border:1px solid transparent;margin-top:10px'   class="">
			<el-scrollbar height='455px'>
        <div style='padding:0px 10px 5px 0px;' class="table_warp">

        <div class="left_table">
          
<div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">设备类别
                
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
				<el-select class='height_100_width_65 font_size_small' size='small' v-model="equipInfo.vessel_type" placeholder="请选择">
                     <el-option
                       v-for="item in [
             {
                    value: 'Ⅰ',
                    label: 'Ⅰ',
                  },
                  {
                    value: 'Ⅱ',
                    label: 'Ⅱ',
                  },
                  {
                    value: 'Ⅲ',
                    label: 'Ⅲ',
                  },
 
                  {
                    value: 'I/SAD',
                    label: 'I/SAD',
                  },
                  {
                    value: 'II/SAD',
                    label: 'II/SAD',
                  },
                  {
                    value: 'III/SAD',
                    label: 'III/SAD',
                  },


                   {
                    value: '类外',
                    label: '类外',
                  },
             ]"
                       :key="item.value"
                       :label="item.label"
                       :value="item.value"
                     ></el-option>
				 </el-select>
               
                  
               </div>
            </div>

			<div class="row font_size_small box_font flex_my color_gray">
               <div class=" height_32 flex_center left_title ">工艺参数</div>
               
            </div>



            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">设计压力 
                （MPa）
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center   width_100">
					<div class="height_32 flex_center border_right left_title width_50">
                     <el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.max_design_pressure_tower'></el-input>
				    </div>
					<div class="height_32 flex_center  width_50">
						<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.min_design_pressure_tower'></el-input>
				    </div>
                  </div>
              
               </div>
            </div>

            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">工作压力 
				
               </div>
               <div class="height_32 flex_center box_font_right  left_title ">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.operating_pressure_tower'></el-input>
                  </div>
            </div>


            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">最大允许工作压力 
				
               </div>
               <div class="height_32 flex_center box_font_right  left_title ">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.mawp_tower'></el-input>
                  </div>
            </div>


              <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">安全阀整定压力 
				
               </div>
               <div class="height_32 flex_center box_font_right  left_title ">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.safety_valve_set_pressure_tower'></el-input>
                  </div>
            </div>

            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">设计温度
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.max_design_temp_tower'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.min_design_temp_tower'></el-input>
                  </div>
               </div>
            </div>




               <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">工作温度
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.max_operating_temp_tower'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.min_operating_temp_tower'></el-input>
                  </div>
               </div>
            </div>

	


            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">介质 
				
               </div>
               <div class="height_32 flex_center box_font_right  left_title ">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.fluid_tower'></el-input>
                  </div>
            </div>



            
            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">介质特性 
				
               </div>
               <div class="height_32 flex_center box_font_right  left_title ">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.fluid_properties_tower'></el-input>
                  </div>
            </div>



               <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">介质密度(G/L)
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.fluid_density_tower_g'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.fluid_density_tower_l'></el-input>
                  </div>
               </div>
            </div>






            	<div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">主体材料
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				{{ shell_mat1_metaid_ForMatter.CS }} /  {{ shell_mat2_metaid_ForMatter.CS }}
               </div>
               <div class="box_font_right flex_my">
                  <div class="height_32 flex_center border_right  left_title width_50">
					
					 <el-cascader
					 style='width:80%'
					 class='height_100_width_65 font_size_small'
            
                placeholder='--'
                :show-all-levels="false"
               v-model="shell_mat1_metaid_ForMatter.values" size="small"
                 :options="cascaderOptions"
                     filterable />
				
                  </div>

                  <div class="height_32 flex_center  left_title width_50">
					
					 <el-cascader
					 style='width:80%'
					 class='height_100_width_65 font_size_small'
            
                placeholder='--'
                :show-all-levels="false"
               v-model="shell_mat2_metaid_ForMatter.values" size="small"
                 :options="cascaderOptions"
                     filterable />
				
                  </div>
                 
               </div>
            </div>



            
            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">腐蚀裕量
				
               </div>
               <div class="height_32 flex_center box_font_right  left_title ">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.corrosion_allowance_tower'></el-input>
                  </div>
            </div>


              <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">焊接头系教(筒体/封头)
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.shell_weldedjoint_coefficient_tower'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.head_weldedjoint_coefficient_tower'></el-input>
                  </div>
               </div>
            </div>


            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">全容积 
				
               </div>
               <div class="height_32 flex_center box_font_right  left_title ">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.full_volume_tower'></el-input>
                  </div>
            </div>


            
            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">工作容积 
				
               </div>
               <div class="height_32 flex_center box_font_right  left_title ">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.operating_volume_tower'></el-input>
                  </div>
            </div>


                <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">塔板类型/塔板数
				
               </div>
               <div class="height_32 flex_center box_font_right  left_title ">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.plate_type_count_tower'></el-input>
                  </div>
            </div>


                    <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">填料高度
				
               </div>
               <div class="height_32 flex_center box_font_right  left_title ">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.packing_height_tower'></el-input>
                  </div>
            </div>


          


	
        



		





           




            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">公称直径
				
               </div>
               <div class="height_32 flex_center box_font_right  left_title ">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.diameter_tower'></el-input>
                  </div>
            </div>


            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">切高
				
               </div>
               <div class="height_32 flex_center box_font_right  left_title ">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.tl_to_tl_tower'></el-input>
                  </div>
            </div>






            
            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">保温材料/厚度
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.insulation_material_tower'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.insulation_thickness_tower'></el-input>
                  </div>
               </div>
            </div>
    


            





		   <div class="row font_size_small box_font flex_my color_gray">
               <div class="box_font_left height_32 flex_my left_title ">
				
               </div>
               
            </div>



			
			<div class="row font_size_small box_font flex_my">
           
		   <div class="box_font_left height_32 flex_my left_title border_right">图纸自然张数
			
		   </div>
		   <div class="box_font_right flex_center height_32 flex_my">
			<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.drawings_count'></el-input>
		   </div>
		   </div>


		   <div class="row font_size_small box_font flex_my">
           
		   <div class="box_font_left height_32 flex_my left_title border_right">折A1张数
			
		   </div>
		   <div class="box_font_right flex_center height_32 flex_my">
			<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.a1_count'></el-input>
		   </div>
		   </div>


		   <div class="row font_size_small box_font flex_my">
           
		   <div class="box_font_left height_32 flex_my left_title border_right">计算书自然张数
			
		   </div>
		   <div class="box_font_right flex_center height_32 flex_my">
			<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.cal_sheet_count'></el-input>
		   </div>
		   </div>


		   <div class="row font_size_small box_font flex_my">
           
		   <div class="box_font_left height_32 flex_my left_title border_right">风险评估报告
			
		   </div>
		   <div class="box_font_right flex_center height_32 flex_my">
			<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.risk_assessment_report'></el-input>
		   </div>
		   </div>


		   <div class="row font_size_small box_font flex_my">
           
		   <div class="box_font_left height_32 flex_my left_title border_right">备注
			
		   </div>
		   <div class="box_font_right flex_center height_32 flex_my">
			<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.note'></el-input>
		   </div>
		   </div>


      </div>
	  </div>
      </el-scrollbar>


		</div>
  </div>
</template>
    
    <script setup>
import {
  Check,
  Delete,
  CircleCheck,
  Platform,
  Refresh,
  Edit,
  Message,
  Search,
  Star,
  DocumentCopy,
  Top,
  Bottom,
  Warning,
} from "@element-plus/icons-vue";

import { ElMessage, ElMessageBox, ElNotification } from "element-plus";
import {
  defineAsyncComponent,
  ref,
  reactive,
  onMounted,
  nextTick,
  computed,
  watch,
} from "vue";
import {
  GetMaterialMetaDatas,
  ModifyEquipModelStatusV2,
  ModifyEquipStatus,
  UpdateEquipVesselType,
  SaveTowerProcessDatas,
  GetTowerProcessDatas,
  calculateshape,
  ImportExcelForModelInput,
  ExportExcelForModelInput,
 
  DeleteNozzle,
  AddNozzle,
  ModifyNozzle,
  GetEquipmentNozzle,
  DeleteAllShape,
  AddShape,
  UpdateLastModifyTime,
  ModifyShape,
  getequipmentshape,
  SaveNozzleDesignDatas,
  saveBEMDesigndatas,
  SaveModelParam,
  DelBEMNozzleDesignDatas,
  GetNozzleReinforcingRingMeta,
  GetNozzleInternalComponentsMeta,
  GetNozzleConnectTubeMaterialMeta,
  GetBEMNozzleDesignDatas,
  getBEMdesigndatas,
  getArrangeAnglemetadatas,
  getbooloptiondatas,
  getGasketTypeMetadatas,
  getStandardMetadatas,
  getRatingMetadatas,
} from "../../../api/equipment/index";
import { NozzleInfo as NozzleInfoOptions } from "../../../utils/nozzleTypeInfo";
import {
  HEquipShapeTypes,
  VEquipShapeTypes,
  ShapeParams,
  NozzleParamOptions,
} from "../../../assets/js/equiipentBaseDatas";
import { liftingLegTypes as liftingLegTypesD } from "../../../assets/js/LiftingLug.js";
import { useEquipmentStore } from "../../../stores/equipment";
import { useRoute } from "vue-router";
let store = useEquipmentStore();
let route = useRoute()
let equip_oid = ref("");
let equipInfo = ref({});
let activeNumberModel = ref(0)


let shell_mat1_metaid_ForMatter = ref({
		CS:'--',
		values:'--',
	})

  let shell_mat2_metaid_ForMatter = ref({
		CS:'--',
		values:'--',
	})


onMounted(async() => {
  equip_oid.value = route.query.equip_oid
  equipInfo.value = JSON.parse(sessionStorage.getItem(equip_oid.value));

  getBEMprocessdatasData();
  activeNumber.value = Number(equipInfo.value.equip_check) / 10;
  activeNumberModel.value = Number(equipInfo.value.model_stage) / 10

      let resCascader = await GetMaterialMetaDatas()
    cascaderOptions.value = transformData(resCascader);
});



  let transformData =(data) =>{
  // 使用对象存储分组结果
  const resultMap = {};

  data.forEach(item => {
    const standard = item.standard;
    const materialType = item.materialType;
    const materialName = item.materialName;

    // 处理标准层级
    if (!resultMap[standard]) {
      resultMap[standard] = {
        value: standard,
        label: standard,
        children: {}
      };
    }

    // 处理材料类型层级
    if (!resultMap[standard].children[materialType]) {
      resultMap[standard].children[materialType] = {
        value: materialType,
        label: materialType,
        children: []
      };
    }

    // 添加材料名称（去重）
    const exists = resultMap[standard].children[materialType].children
      .some(child => child.value === materialName);
      
    if (!exists) {
      resultMap[standard].children[materialType].children.push({
        value: materialName,
        label: materialName
      });
    }
  });

  // 转换为最终数组格式
  return Object.values(resultMap).map(standard => ({
    value: standard.value,
    label: standard.label,
    children: Object.values(standard.children).map(type => ({
      value: type.value,
      label: type.label,
      children: type.children
    }))
  }));
}

let activeNumber = ref(10);
  let cascaderOptions =ref([])
let SaveBEMProcessDatasD = async () => {
  try {
    forMatterMetaid()
    sessionStorage.setItem(equip_oid.value, JSON.stringify(equipInfo.value));

     let obj = {
        "oid": processForm.value.oid||'',
equip_oid: processForm.value.equip_oid,

 "max_design_pressure_tower": processForm.value.max_design_pressure_tower,
        "min_design_pressure_tower":processForm.value.min_design_pressure_tower,
        "operating_pressure_tower": processForm.value.operating_pressure_tower,
        "mawp_tower": processForm.value.mawp_tower,
        "safety_valve_set_pressure_tower": processForm.value.safety_valve_set_pressure_tower,
        "min_design_temp_tower": processForm.value.min_design_temp_tower,
        "max_design_temp_tower": processForm.value.max_design_temp_tower,
        "min_operating_temp_tower": processForm.value.min_operating_temp_tower,
        "max_operating_temp_tower": processForm.value.max_operating_temp_tower,
        "fluid_tower": processForm.value.fluid_tower,
        "fluid_properties_tower": processForm.value.fluid_properties_tower,
        "fluid_density_tower_G": processForm.value.fluid_density_tower_g,
        "fluid_density_tower_L": processForm.value.fluid_density_tower_l,
        "main_material1_tower": processForm.value.main_material1_tower,
        "main_material2_tower": processForm.value.main_material2_tower,
        "corrosion_allowance_tower": processForm.value.corrosion_allowance_tower,
        "shell_weldedjoint_coefficient_tower": processForm.value.shell_weldedjoint_coefficient_tower,
        "head_weldedjoint_coefficient_tower": processForm.value.head_weldedjoint_coefficient_tower,
        "full_volume_tower": processForm.value.full_volume_tower,
        "operating_volume_tower": processForm.value.operating_volume_tower,
        "plate_type_count_tower": processForm.value.plate_type_count_tower,
        "packing_height_tower": processForm.value.packing_height_tower,
        "diameter_tower": processForm.value.diameter_tower,
        "tl_to_tl_tower": processForm.value.tl_to_tl_tower,
        "insulation_material_tower":  processForm.value.insulation_material_tower,
        "insulation_thickness_tower": processForm.value.insulation_thickness_tower,
        "drawings_count": processForm.value.drawings_count,
        "a1_count": processForm.value.a1_count,
        "cal_sheet_count":  processForm.value.cal_sheet_count,
        "risk_assessment_report": processForm.value.risk_assessment_report,
        "note":  processForm.value.note,
}
if(!obj.oid) delete obj.oid

await UpdateEquipVesselType({
         equip_oid:equip_oid.value,
         vessel_type:equipInfo.value.vessel_type
      })
    await SaveTowerProcessDatas({
     ...obj,
      equip_oid:equip_oid.value,
    modify_user:JSON.parse(localStorage.getItem("userMessage")).user_name,
    });
    ElMessage({
      message: "保存工艺数据成功",
      type: "success",
    });
    getBEMprocessdatasData();
  } catch (error) {
    ElMessage({
      message: "请检查工艺参数是否正确",
      type: "error",
    });
  }
};


  let forMatterMetaid = () => {
		processForm.value.main_material1_tower = `${shell_mat1_metaid_ForMatter.value.CS}|${shell_mat1_metaid_ForMatter.value.values}`
		processForm.value.main_material2_tower = `${shell_mat2_metaid_ForMatter.value.CS}|${shell_mat2_metaid_ForMatter.value.values}`
	
	}



let getBEMprocessdatasData = async () => {
  let res = await GetTowerProcessDatas(equip_oid.value);
  
  if (res.length > 0) {
      let obj = res[0]
     for (const key in obj) {
          const lowerkey = key.toLowerCase();
          obj[lowerkey] =  obj[key];
      }
      processForm.value = obj;

      if(processForm.value.main_material1_tower&&processForm.value.main_material1_tower.includes('|')){
				shell_mat1_metaid_ForMatter.value.CS = processForm.value.main_material1_tower.split('|')[0]
				shell_mat1_metaid_ForMatter.value.values = processForm.value.main_material1_tower.split('|')[1].split(',')
			}


      if(processForm.value.main_material2_tower&&processForm.value.main_material2_tower.includes('|')){
				shell_mat2_metaid_ForMatter.value.CS = processForm.value.main_material2_tower.split('|')[0]
				shell_mat2_metaid_ForMatter.value.values = processForm.value.main_material2_tower.split('|')[1].split(',')
			}
	
    }



  if (res.length > 0) {
    processForm.value = res[0];
  }
};

let activeName = ref("管程参数");
let showTran = ref(false);
watch(
  activeName,
  () => {
    showTran.value = false;
    setTimeout(() => {
      showTran.value = true;
    }, 30);
  },
  { immediate: true }
);

let visible = ref(false);

let checkComplete = async () => {
 let res =  await ModifyEquipStatus({
    equip_oid: equip_oid.value,
    equip_check: "30",
    equip_checker: JSON.parse(localStorage.getItem("userMessage")).user_name,
  });
  if(res.data !== 'True'){
    ElMessage({
      message: res.data,
      type: "error",
    });
  }else{
    activeNumber.value = 30;
  equipInfo.value.equip_check = "30";
  sessionStorage.setItem(equip_oid.value, JSON.stringify(equipInfo.value));
  ElMessage({
    message: "设计状态修改成功",
    type: "success",
  });
  await UpdateLastModifyTime({ equip_oid: equip_oid.value });
  }
 
};



let changeStatueModel =  async(num,e) => {
  let str = num === 10 ? '校核' : num === 20 ?  '已完成' : ''
	let bool = await ElMessageBox.confirm(`您确定要把当前状态修改为${str}吗？`, '提示', {
		confirmButtonText: '确定',
		cancelButtonText: '取消',
		type: 'warning',
	})
  if(bool){
	let  res = await ModifyEquipModelStatusV2({
	
	proj_oid: equipInfo.value.proj_oid,
	equip_no: equipInfo.value.equip_no,
	drawing_stage:equipInfo.value.drawing_stage,
	model_stage:num,
  equip_user: JSON.parse(localStorage.getItem("userMessage")).user_name,
});

if(res !== 'True'){
  ElMessage({
	message: res.data,
	type: "error",
  });
}else{
	activeNumberModel.value = num / 10;
	equipInfo.value.model_stage = num ;
sessionStorage.setItem(equip_oid.value, JSON.stringify(equipInfo.value));
ElMessage({
  message: "设计状态修改成功",
  type: "success",
});
await UpdateLastModifyTime({ equip_oid: equip_oid.value });
}

  }


}



let changeStatue =  async(num) => {
  let str = num === 10 ? '校核' : num === 20 ?  '审核' : '已完成'
  let bool = await ElMessageBox.confirm(`您确定要把当前状态修改为${str}吗？`, '提示', {
		confirmButtonText: '确定',
		cancelButtonText: '取消',
		type: 'warning',
	})
  if(bool){
    let  res = await ModifyEquipStatus({
      proj_oid: equipInfo.value.proj_oid,
	equip_no: equipInfo.value.equip_no,
	drawing_stage:equipInfo.value.drawing_stage,
  equip_check: num,
  equip_user: JSON.parse(localStorage.getItem("userMessage")).user_name,
});

if(res !== 'True'){
  ElMessage({
    message: res.data,
    type: "error",
  });
}else{
  activeNumber.value = num / 10;
equipInfo.value.equip_check = num ;
sessionStorage.setItem(equip_oid.value, JSON.stringify(equipInfo.value));
ElMessage({
  message: "设计状态修改成功",
  type: "success",
});
await UpdateLastModifyTime({ equip_oid: equip_oid.value });
}
  }

}


let designComplete = async () => {
 let  res = await ModifyEquipStatus({
    equip_oid: equip_oid.value,
    equip_check: "20",
    equip_checker: JSON.parse(localStorage.getItem("userMessage")).user_name,
  });

  if(res.data !== 'True'){
    ElMessage({
      message: res.data,
      type: "error",
    });
  }else{
    activeNumber.value = 20;
  equipInfo.value.equip_check = "20";
  sessionStorage.setItem(equip_oid.value, JSON.stringify(equipInfo.value));
  ElMessage({
    message: "设计状态修改成功",
    type: "success",
  });
  await UpdateLastModifyTime({ equip_oid: equip_oid.value });
  }
 
};

let processForm = ref({
  design_pressure: "",
  design_temp: "",
  diameter: "",
  TL_to_TL: "",
  tower_plate_type_count: "",
  packing_height: "",
  basic_wind_pressure: "",
  seismic_design_intensity: "",
  fluid: "",
  fluid_properties: "",
  main_pressure_comp_matl: "",

  drawings_count: "",
  A1_count: "",
  cal_sheet_count: "",
  note: "",
  risk_assessment_report: "",
  fluid_density:'',
  insulation_thickness:'',
});

</script>
    
    <style scoped lang="scss">
.botton_sabe {
  z-index: 777;
  position: absolute;
  top: 15px;
  right: 15px;
}
.from_tenbal {
  margin-top: 20px;
}

.fontent_s {
  font-weight: bolder;
}

.item_content_d {
  padding: 5px 15px;
  border-bottom: 1px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.equip-info {
  position: relative;
  background-color: #fff;
  padding: 20px;
  border-radius: 4px;
}

.flex_style {
  margin-top: 20px;
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.equip-info {

  height: 520px;
}
.content_top {
  margin-top: 30px;
}
.button_item_b {
  margin-top: 20px;
  padding: 0 30px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}


::v-deep(.el-form-item) {
  margin-bottom: 10px;
  margin-right: 6px;
}

::v-deep(.style2){
  .el-input--small{
    width: 144px;
  }
}

.content_steps_ab{

  display:flex;
		left: 10%;
top: 41%;
transform: translate(0%,-50%) scale(0.9);

width: 80%;
}




.table_warp{
    display: flex;
    
    width: 100%;
    .height_32{
      height: 26px;
    }
  .flex_my{
    display: flex;
    align-items: center;
  }
  .flex_center{
    display: flex;
    align-items: center;
   justify-content: center;
  }
  .left_title{

    
    white-space: pre;
    font-weight: bolder;
  }
  .box_font_left{
    
    width: 34%;
  }
  .box_font_right{
    
    width: 66%;
  }
  .font_size_small{
    font-size: 12px;
  }
  .row{
    padding-left: 10px;
    border-bottom:1px solid #999 ;
  }
    .box1{
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .font_weight{
      font-weight: bolder;
      font-size: 17px;
    }
    .border_left{
      border-left: 1px solid #999;
    }
    .border_top{
      border-top: 1px solid #999;
    }
    .border_right{
      
      border-right: 1px solid #999;
    }
    .border_bottom{
      border-bottom: 1px solid #999;
    }
    .left_table{
      width: 100%;
      border: 3px solid rgb(13, 88, 173);
      border-left:3px solid rgb(13, 88, 173);
      border-bottom:3px solid rgb(13, 88, 173);

      border-top:3px solid rgb(13, 88, 173);
    }
    .height_100_width_65{
      height: 94%;
      width: 100%;
    }
    .width_50{
      width: 50%;
    }
    .width_10{
      width: 10%;
    }
    .flex{
      display: flex;
    }
    .width_22{
      width:22.5%
    }
    .width_20{
      width: 18.9%;
    }
    
    .width_90{
      width: 90%;
    }

    .width_30{
      width: 30%;
    }
    .rl{
      writing-mode: vertical-rl;
    }
    .height_100{
      height: 100%;
    }
    .right_table{
      width: 58%;
      border: 1px solid rgb(13, 88, 173);
      border-right:3px solid rgb(13, 88, 173);
      border-bottom:3px solid rgb(13, 88, 173);

      border-top:3px solid rgb(13, 88, 173);
    }
    .all_table{
      border: 1px solid rgb(13, 88, 173);
      border-right:3px solid rgb(13, 88, 173);
      border-bottom:3px solid rgb(13, 88, 173);
      border-left:3px solid rgb(13, 88, 173);
      border-top:3px solid rgb(13, 88, 173);
      width: 100%;
     
    }
    .over_y{
      overflow-y: scroll;
    }
    .no_left_padding{
      padding-left: 0;
    }
    .padding_left_10{
      padding-left: 10px;
    }
    .width_25{
      width: 25.5%;
    }
    .width_my_1{
      width:38%
    }

    .width_1{
      width:6%
    }
    .width_2{
      width:8%
    }
    .width_3{
      width:8%
    }
    .width_4{
      width:8%
    }
    .width_5{
      width:25%
    }
    .width_6{
      width:8%
    }
    .width_7{
      width:13%
    }

    .width_8{
      width:24%
    }
    .width_my_1_1{
      width:20%
    }
    .width_my_1_2{
      width:80%
    }
	.color_gray{
		background: #eee;
	}

  .width100{
    width: 100%;
  }
  }
</style>
    